package com.weidey.blog.domain;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.weidey.common.annotation.Excel;
import com.weidey.common.core.domain.BaseEntity;

/**
 * 博客文章对象 blog_article
 * 
 * @author weidey
 * @date 2024-09-09
 */
@Setter
@Getter
public class Article extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 文章id */
    @Excel(name = "文章id")
    private Long id;

    /** 作者id */
    private Long authorId;

    /** 分组 */
    private Long groupId;

    /** 标题 */
    @Excel(name = "标题")
    private String title;

    /** 简介 */
    @Excel(name = "简介")
    private String synopsis;

    /** 内容 */
    @Excel(name = "内容")
    private String content;

    /** 封面图 */
    @Excel(name = "封面图")
    private String covers;

    /** 收藏数 */
    @Excel(name = "收藏数")
    private Integer star;

    /** 点赞数 */
    @Excel(name = "点赞数")
    private Integer likes;

    /** 浏览量 */
    @Excel(name = "浏览量")
    private Integer views;

    /** 状态 */
    @Excel(name = "状态")
    private String isState;

    /** 审核 */
    @Excel(name = "审核")
    private String isAudit;

    /** 是否删除 */
    @Excel(name = "是否删除")
    private String isDelete;

    /** 删除时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date deleteTime;
    /** 博客分组 */
    private Group group;
    /** 博客标签 */
    private List<Label> labels;
    /** 博客标签ID */
    private int[] tags;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("authorId", getAuthorId())
            .append("groupId", getGroupId())
            .append("title", getTitle())
            .append("synopsis", getSynopsis())
            .append("content", getContent())
            .append("covers", getCovers())
            .append("star", getStar())
            .append("likes", getLikes())
            .append("views", getViews())
            .append("remark", getRemark())
            .append("isState", getIsState())
            .append("isAudit", getIsAudit())
            .append("isDelete", getIsDelete())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("deleteTime", getDeleteTime())
            .toString();
    }
}
